﻿using System.Collections.Generic;

namespace Map
{
    public class BaseObject
    {
        private static int CurID = 1; 
        public static Dictionary<int,BaseObject> Objects = new Dictionary<int, BaseObject>(); 
        
        public string Name;
        public int ID = 1;

        protected BaseObject(int id = 0)
        {
            ID = id == 0 ? CurID++ : id;
            Objects.Add(ID,this);
        }

        public virtual void Delete()
        {
            Objects.Remove(ID);
        }
    }
}
